home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / util / misc / ispell31.lha / ispell-3.1.18src / Amiga / interfaces / shell / spellcheckword.rexx < prev    next >
OS/2 REXX Batch file  |  1992-09-27  |  2KB  |  57 lines

  1. /*rx
  2.  *  SpellCheckWord.rexx --- program to spell check a word using the ISpell
  3.  *  server and do some fancy magic with GUISpell if the word is incorrectly
  4.  *  spelled.
  5.  *
  6.  *  Something like the following works great in VLT 5.517 (27.3.92) or
  7.  *  later (enter without line breaks into Operation/Mouse Support...):
  8.  *
  9.  *  ~rx ("move %X %Y"; "extr reviewlineatcursor"; "move %x %y"; 
  10.  *   s = " "vlt.reviewlineatcursor" "; a = lastpos(" ",s,%X+1);
  11.  *   b = pos(" ",s,%X+1); "move "a b-1 %Y %Y;
  12.  *   address command "spellcheckword" substr(s,a,b-a) "VLT")
  13.  *
  14.  *  Thanks Willy for adding the features needed to do the above in VLT!
  15.  *
  16.  *  Copyright © 1992  Loren J. Rittle
  17.  *  Use as you will, just document your changes and keep my copyright
  18.  *  notice intact.  Feel free to mail enhancements to me.
  19.  *
  20.  *  Loren J. Rittle
  21.  *  rittle@comm.mot.com
  22.  *  Wed May 13 05:56:10 1992
  23.  */
  24.  
  25. options results
  26.  
  27. if left(address(), 4) ~== 'WSH_' then
  28.   address command
  29.  
  30. parse arg word PublicScreen .
  31.  
  32. if ~show(ports, 'IRexxSpell') then
  33.   do
  34.     'run <nil: >nil: ispell -r >nil: <nil:'
  35.     waitforport 'IRexxSpell'
  36.   end
  37.  
  38. address 'IRexxSpell' quickcheck word
  39. if result = 'bad' then
  40.   do
  41.     if ~show(ports, 'GUISpell') then
  42.       do
  43.         'run <nil: >nil: GUISpell <nil: >nil:'
  44.         waitforport 'GUISpell' 
  45.       end
  46.     if show(ports, 'GUISpell') then
  47.       do
  48.     if PublicScreen ~= '' then
  49.       address 'GUISpell' jump PublicScreen
  50.     address 'GUISpell' check word
  51.       end
  52.     else
  53.       address 'PingServer' beep
  54.   end
  55.  
  56. exit 0
  57.